package com.readaloud.wicket;

import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication;

import com.readaloud.dao.InvertedIndexDao;
import com.readaloud.dao.InvertedIndexDaoImpl;

/**
 * Application object for your web application.
 * <p/>
 * If you want to run this application without deploying, run the Start class.
 */
public class WicketApplication extends WebApplication {

	private InvertedIndexDao invertedIndexDao;
	
	@Override
    public Class<? extends Page> getHomePage() {
        return IndexPage.class;
    }

    public static WicketApplication get() {
        return (WicketApplication) WebApplication.get();
    }
    
    public InvertedIndexDao getInvertedIndexDao(){
    	if(invertedIndexDao == null){
    		invertedIndexDao = new InvertedIndexDaoImpl();
    	} 
    	return invertedIndexDao; 
    }
}
